<template>
    <span v-if="show" class="auth-component">
        <slot></slot>
    </span>
</template>
<script>
    export default {
        props: ['code'],
        data() {
            return {
                show: false
            }
        },
        mounted() {
            const permissions = sessionStorage.getItem("zhanyun.permissionList")
            const permissionList = permissions.split(",")
            if(permissionList.indexOf(this.code) > -1) {
                this.show = true
            }
        }
    }
</script>
<style scoped lang="scss">
</style>
